package com.aconcagua.beans {
  public class BeanDefinitionException extends Error {
    public static const NO_TYPE: int = 0;
    public static const DUPLICATE_NAME: int = 1;
    
    public function BeanDefinitionException(name:String, id: int) {
      super(resolveMessage(name, id), id);
    }
    
    protected function resolveMessage(name: String, id:int): String {
      switch(id) {
        case NO_TYPE:
          return "Configuration problem: Bean name '" + name + "' has no type."
        case DUPLICATE_NAME: 
          return "Configuration problem: Bean name '" + name + "' is already used.";
        default:
          return "Unexpected exception in Bean name: '" + name + "'";
      }
    }
  }
}